package com.inxedu.os.edu.service.systemMsg.systemMsgImpl;

import com.inxedu.os.edu.dao.EduMsgSystemMapper;
import com.inxedu.os.edu.pojo.EduMsgSystem;
import com.inxedu.os.edu.pojo.EduMsgSystemExample;
import com.inxedu.os.edu.pojo.MsgSystem;
import com.inxedu.os.edu.service.systemMsg.MsgSystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MsgSystemServiceImpl implements MsgSystemService {
    @Autowired
    private EduMsgSystemMapper eduMsgSystemMapper;

    /**
     * 查询系统消息列表
     * @return
     */
    @Override
    public List<EduMsgSystem> getMsgSystemList(MsgSystem msgSystem) {
        List<EduMsgSystem> msgSystems = eduMsgSystemMapper.selectMsgSystemList(msgSystem);
        EduMsgSystemExample example=new EduMsgSystemExample();
//        List<EduMsgSystem> eduMsgSystems = eduMsgSystemMapper.selectByExample(example);
        return msgSystems;
    }

    @Override
    public int addMsgSystem(EduMsgSystem eduMsgSystem) {
        int insert = eduMsgSystemMapper.insert(eduMsgSystem);
        return insert;
    }

    @Override
    public int deleteMsg(int ids) {
        return eduMsgSystemMapper.deleteByPrimaryKey(ids);
    }
}
